package com.joshua.viewtest.demo;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import com.joshua.viewtest.R;

public class OtherActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_other);

        TextView txt = (TextView) findViewById(R.id.text);
        Drawable drawable = null;
        drawable = getResources().getDrawable(R.drawable.ic_edit);
        if (drawable != null)
            drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
        txt.setCompoundDrawables(drawable, drawable, drawable, drawable);
    }
}
